<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>添加</title>
    <link href="../../layuiadmin/js/adm/css/bootstrap.css" rel="stylesheet">
    <script src="../../layuiadmin/js/adm/js/vue.js"></script>
    <script src="../../layuiadmin/js/adm/js/vue-resource.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.min.js"></script>
    <script src="../../layuiadmin/js/adm/js/bootstrap.js"></script>
    <script src="../../layuiadmin/js/adm/js/getUrlParam.js"></script>
    <script src="../../layuiadmin/js/adm/js/date.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.cookie.js"></script>
    <!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
    <div id="app" class="container-fluid"  style="margin: 10px 5%" >
        <form class="form-inline">
            <div class="row">
                <input type="text" v-model="sname" class="form-control" placeholder="签到人"> &nbsp;&nbsp;
                开始时间：<input type="date" v-model="kdate" class="form-control">&nbsp;&nbsp;
                结束时间：<input type="date" v-model="jdate" class="form-control">&nbsp;&nbsp;
                <button type="button" class="btn btn-primary" @click="postfurry()">开始检索</button>
            </div>

            <div class="row" style="margin-top: 20px">
                    
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>类型</th>
                                    <th>签到人</th>
                                    <th>签到日期</th>
                                    <th>签到时间</th>
                                    <th>签到地点</th>
                                    <th>状态</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="item in sign">
                                    <td>{{item.signType}}</td>
                                    <td>{{item.userId.userName}}</td>
                                    <td>{{item.signDate}}</td>
                                    <td>{{item.signTime}}</td>
                                    <td>{{item.signSite}}</td>
                                    <td>{{item.signZt}}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    
            </div>
        </form>
    </div>
    

    <script>
          var vm=new Vue({
            el:'#app',
            data:{
                sign:[
                   
                ],
                sname:"",
                kdate:"",
                jdate:""
            
            },
            methods: {
                postall(){
                    var userId=$.cookie("redisId");
                    this.$http.post('http://localhost:8080/sign/listall',{"userId":userId},{emulateJSON:true}).then(resutl =>{
                        var dat=eval("("+resutl.body+")")
                            this.sign=new Array()   //每次重新new一个list集合给定义的list集合
                            for(var i=0;i<dat.length;i++){
                                this.sign.push(dat[i])
                            }
                    })
                },
                postfurry(){
                    var userId=$.cookie("redisId");
                    this.$http.post('http://localhost:8080/sign/listfurry',{"sname":this.sname,"kdate":this.kdate,"jdate":this.jdate,"userId":userId},{emulateJSON:true}).then(resutl =>{
                        var dat=eval("("+resutl.body+")")
                            this.sign=new Array()   //每次重新new一个list集合给定义的list集合
                            for(var i=0;i<dat.length;i++){
                                this.sign.push(dat[i])
                            }
                    })
                }
            },
            created () {
                this.postall()
            }
        })      
    </script>

</body>
</html>